import re
def clear_code(file_name):
    content = open(file_name).read()
    lines = ''
    for line in content.splitlines():
        print line
        if re.findall('^[\[0-9]', line):
            continue
        lines = lines + line + '\n'
    f = open('backup.txt', 'w')
    f.write(lines)

if __name__ == "__main__":
    file_path = 'code.txt'
    clear_code(file_path)
